package com.learn.egmvc1.demos.web.controller;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class EmpController {

    //添加员工
    @RequestMapping("/emp/insert")
    @ResponseBody
    public String addemp(String name, int salary,String job){
        System.out.println(name + salary + job);
        return "添加成功";
    }

    //查询所有员工的信息
    @RequestMapping("/emp/select")
    @ResponseBody
    public String selectemp(){
        return "恭喜，查询成功";
    }

    //修改员工信息
    @RequestMapping("/emp/update")
    @ResponseBody
    public String updateemp(String id,String name,int salary,String job){
        System.out.println(id + name + salary + job);
        return "修改成功";
    }

    //删除员工信息
    @RequestMapping("/emp/delete")
    @ResponseBody
    public String deleteemp(String id){
        System.out.println(id);
        return "删除成功";
    }

}
